<?php
/**
 * @var $this \yii\web\View
 * @var $models \app\models\Admin[]
 * User: JSparrow
 * DateTime: 2016/11/22 15:53
 * Created by PhpStorm.
 */

use yii\bootstrap\Html;

$this->title = '管理员';

$this->params['breadcrumbs'][] = $this->title;
?>
<div class="row">
    <div class="col-md-3">
        <?= Html::a('新增管理员', ['admin/create'], ['class'=>'btn btn-primary btn-block']) ?>
    </div>
    <div class="col-md-9">
        <div class="box box-primary">
            <div class="box-body table-responsive">
                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>用户名</th>
                            <th>手机</th>
                            <th>电子邮件</th>
                            <th>最后登陆</th>
                        </tr>
                    </thead>
                    <tbody>
                    <?php /** @var \app\models\Admin $model */
                    foreach ($models as $model): ?>
                    <tr>
                        <td><?= $model->id ?></td>
                        <td>
                            <?= Html::a($model->username, ['admin/view', 'id'=>$model->id]) ?>
                        </td>
                        <td><?= $model->mobile ?></td>
                        <td><?= $model->email ?></td>
                        <td><?= $model->profile->nickname?></td>
                    </tr>
                    <?php endforeach; ?>
                    </tbody>
                </table>
            </div>
            <div class="box-footer">

            </div>
        </div>
    </div>
</div>
